<?php
	class phep_tinh
	{
		var $so_thu_1=0;
		var $so_thu_2=0;
		function get_so_thu_1()
		{
			return $this->so_thu_1;
		}
		function set_so_thu_1($gia_tri)
		{
			$this->so_thu_1=$gia_tri;
		}
		function get_so_thu_2()
		{
			return $this->so_thu_2;
		}
		function set_so_thu_2($gia_tri)
		{
			$this->so_thu_2=$gia_tri;
		}
		function TinhCong()
		{
			return $this->so_thu_1+$this->so_thu_2;
		}
		function TinhTru()
		{
			return $this->so_thu_1-$this->so_thu_2;
		}
		function TinhNhan()
		{
			return $this->so_thu_1*$this->so_thu_2;
		}
		function TinhChia()
		{			
			return @($this->so_thu_1/$this->so_thu_2);
		}
	}
	$tinhtoan=new phep_tinh();
	echo 	"a = ".$tinhtoan->get_so_thu_1().", b = ".	$tinhtoan->get_so_thu_2()."<br />";
	$tinhtoan->set_so_thu_1(4);
	$tinhtoan->set_so_thu_2(0);
	echo 	"a = ".$tinhtoan->get_so_thu_1().", b = ".	$tinhtoan->get_so_thu_2()."<br />";
	$tong=$tinhtoan->TinhCong();
	$hieu=$tinhtoan->TinhTru();
	$tich=$tinhtoan->TinhNhan();
	$thuong=$tinhtoan->TinhChia();
	echo "Tong: $tong - Hieu: $hieu - Tich: $tich";
	echo " - Thuong: $thuong";
?>